package cn.kgc.myblog.controller.cuilibo;

import cn.kgc.myblog.entity.User;
import cn.kgc.myblog.service.cuilibo.CuiliboUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author cuilibo
 * @create 2020-01-02 15:28
 */
@Controller
public class UserContorller {

    @Resource
    private CuiliboUserService userService;
@PostMapping(value = "updatePassword",produces = "application/json")
    public Map<String,Object> updatePasswordByPhone(User user){
    Map<String,Object> map = new HashMap<>();
    int i = userService.updatePasswordByphone(user);
    if (i>0){
        map.put("msg","修改成功");
        map.put("status",true);
    }else{
        map.put("msg","修改失败");
        map.put("status",false);
    }
    return map;
}
}
